﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Web;
using System.Web.UI;

namespace NS_QuangCaoTiepThiBUS
{
    public class Alert
    {
        public static void Show(string msg)
        {
            string cleanMsg = msg.Replace("'", "\'");

            string script = "<script type=\"text/javascript\">alert('" + cleanMsg + "');</script>";

            Page p = HttpContext.Current.CurrentHandler as Page;

            if (p != null && !p.ClientScript.IsClientScriptBlockRegistered("alert"))
            {
                p.ClientScript.RegisterClientScriptBlock(typeof(Alert), "alert", script);
            }
        }
    }
}
